Implementation of Viewport Zoom Check
https://www.w3.org/WAI/standards-guidelines/act/rules/b4f0c3
Summary
A comprehensive improvement has been implemented for reflow suite, including checking that the meta viewport allows zooming up to 200%.
New Feature Implemented
1. Test Step IsZoomeable
Location: src/a11y_test_definitions/test_step/common.py
Feature:
- Verifies that the meta viewport does not prevent zooming up to 200%
- Implements the "Meta viewport allows for zoom" rule
- Runs before reflow tests to detect early restrictions
Cases that PASS:
html
<meta name="viewport" content="user-scalable=yes" />
<meta name="viewport" content="maximum-scale=2.0" />
<meta name="viewport" content="maximum-scale=-1" />
<meta name="viewport" content="width=device-width" />Cases that FAIL:
html
<meta name="viewport" content="user-scalable=no" />
<meta name="viewport" content="maximum-scale=1.5" />
<meta name="viewport" content="maximum-scale=1.0" />
<meta name="viewport" content="maximum-scale=yes" />INAPPLICABLE Cases:
- No meta viewport
- Meta viewport without content attribute
- Empty content or without zoom properties
4. Complete Unit Tests
Location: tests/test_is_zoomeable.py
Coverage:
- All PASS cases of the ACT rule
- All FAIL cases of the ACT rule
- All INAPPLICABLE cases of the ACT rule
- Cases edge: multiple metas, case-insensitive, whitespace
- Error and exception handling
- Unit tests for helper methods
Implementation Benefits
- Verifies that text and content can be resized up to 200%
- Detects viewport restrictions that would prevent zooming
- Complements content loss tests
- Identifies viewport issues before the zoom test
- Avoids false negatives in reflow tests
- Provides specific feedback on restrictions
- Can have its own report
